<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>
<html>
 <head>
    <title>物料信息管理</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
	<% 
	String typeName = request.getParameter("typeName");
	if(null != typeName){
		typeName = new String(typeName.getBytes("iso-8859-1"), "utf-8");
	}
	%>
	<c:set var="typeName" scope="page" value="<%=typeName %>"/> 
	<script src="${ctx}/js/ligerUI/js/plugins/ligerLayout.js" type="text/javascript"></script>
	<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/public/windowalert";
		
		function createSearch(){
			init(1,6,'100,100,100,100,100,100','10%');
			//第一行的数据
			addCommon(0,0,"lable","物料编码：");
			addCommon(0,1,"txtlike","zd001Code");
			addCommon(0,2,"lable","物料名称：");
			addCommon(0,3,"txtlike","zd002Name");
			addCommon(0,4,"lable","规格型号：");
			addCommon(0,5,"txtlike","zd004Model");
			//<c:if test="${not empty typeName}">
			//addCommon(0,6,"hidden","typeName","${typeName}");
			//</c:if>
			init(1,6,'100,100,100,100,100,100','10%');
			addCommon(1,0,"lable","物料尺寸：");
			addCommon(1,1,"txtlike","zd026Size");
		}
		
		function searchAP(){
			multipleSearch("#table1",true,"",basic_Url+"/itemlist.do");
		}
		var grid;
		$(function(){
				grid = $("#table1").ligerGrid({
		        columns: [
							{ display: 'id', name: 'id', width: 1,hide:true },
		                  { display: '编码', name: 'zd001Code', width: 145 },
		                  { display: '名称', name: 'zd002Name', width: 145 },
		                  { display: '物料类型', name: 'zd029MaterTypeId', width: 110,render: function (item)
			                	 {
	                		 	if(item.basicMaterialsTypeDO==null){
	                			 	return "";
	                		 	}else{
	                			 	return item.basicMaterialsTypeDO.zd002Name;
	                		 	}
	                		 } 
		                  },
		                  { display: '型号', name: 'zd004Model', width: 125},
		                  { display: '颜色', name: 'zd033Color', width: 100},
		                  { display: '材质', name: 'zd034Quality', width: 100},
		                  { display: '尺寸', name: 'zd026Size', width: 100},
		                  { display: '基本单位', name: 'zd007Unit', width: 60, render: function (item){
		                		 if(item.basicStapleUnitDO==null){
		                			 return "";
		                		 }else{
		                			 return item.basicStapleUnitDO.zd002Name;
		                		 }
		                  	}
		                  },
		                  { display: '单价', name: 'zd009Price', width: 60 },
		                  { display: '最低库存', name: 'zd011MinmunInventory', width: 60 },
		                  { display: '最高库存', name: 'zd012HighestInventory', width: 60 },
		                  { display: '描述', name: 'zd006Description', width: 140 }
		                      ],  usePager: true,pageSize:30,
		                    //<c:if test="${not empty typeName}">
		                    //  parms:[{ name: 'filters', value: '{"groupOp":"AND","rules":[{"field":"typeName","op":"eq","data":"${typeName}"}]}'},{ name : '_search' , value : true}],
		                    //</c:if>
		                      url : basic_Url+"/itemlist.do?ID=${ID}",
		                      width: "100%", height:"98%", checkbox: true
		                  });
			$("#pageloading").hide();
		});
		
		function getSelected(){
			var rows = grid.getCheckedRows();
			 return rows;
		}
		
		function Close(){
			CloseDialog();
		}
		//按回车 ，查询
		document.onkeydown=keyListener;   
		function keyListener(e){   
		    e = e ? e : event;  
		    if(e.keyCode == 13){   
		    	searchAP();
		    }   
		}  
	</script>
	
  </head>
 <body style="padding:10px" onload="createSearch()">  
       <div id="layout1">
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
<!--    </div> -->
    </body>
</html>